import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/login/index'
import Register from '../views/register/index'
import Index from '../views/layout/index'
import test from '../views/layout/components/test/test'
import test2 from '../views/layout/components/test/test2'
import Home from '../components/Home'
// 采购
import PurchaseSearch from '@/components/purchase/search/search'
import PurchaseAdd from '../components/purchase/add/add'
import lackMaterial from '../components/purchase/lackMaterial/lackMaterial'
// 询价
import InquirySearch from '@/components/inquiry/search/search'
import InquiryAdd from '../components/inquiry/add/add'
//销售
import SaleSearch from '@/components/sale/search/search'
import SaleAdd from '../components/sale/add/add'
//入库
import InboundSearch from '@/components/inbound/search/search'
import InboundAdd from '../components/inbound/add/add'


Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        // name: 'home',
        //redirect页面跳转
        redirect: '/login',
    },
    {
        path: '/login',
        name: 'Login',
        component: Login
    },
    {
        path: '/register',
        name: 'Register',
        component: Register
    },
    {
        path: '/index',
        // name: 'Index',
        redirect: '/home',
        component: Index,
        children: [
            {
                path: '/home',
                component: Home
            },
            {
                path: '/purchase/add',
                component: PurchaseAdd
            },
            {
                path: '/purchase/search',
                component: PurchaseSearch
            },
            {
                path: '/purchase/lackMaterial',
                component: lackMaterial
            },
            {
                path: '/inquiry/add',
                component: InquiryAdd
            },
            {
                path: '/inquiry/search',
                component: InquirySearch
            },
            {
                path: '/sale/add',
                component: SaleAdd
            },
            {
                path: '/sale/search',
                component: SaleSearch
            },
            {
                path: '/inventory/inbound/add',
                component: InboundAdd
            },
            {
                path: '/inventory/inbound/add',
                component: InboundSearch
            }
        ]
    },


]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL,
    routes
})

export default router
